package cn.dengta.webapp.user.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * 联系方式
 */
@Getter
public enum ChannelType implements ValueProxyImpl<ChannelType, Integer> {
	/** tiktok */
	TT(0, "tiktok"),
	/** google */
	GG(1, "google"),
	/** facebook */
	FB(2, "facebook"),
	/** officialWeb */
	GW(3, "officialWeb"),
	//
	;

	// 定义私有变量
	@EnumValue
	public final Integer value;
	final ValueProxy<ChannelType, Integer> proxy;

	// 构造函数，枚举类型只能为私有
	ChannelType(Integer value, String label) {
		this.value = value;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	public static ChannelType[] getValues() {
		return ValueProxy.getCachedArray(ChannelType.class, ChannelType::values);
	}

	public static ChannelType of(Integer value) {
		return TT.getValueOf(value);
	}

}
